"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var test_pb_1 = require("./gen/test_pb");
var grpc = require("@grpc/grpc-js");
var test_grpc_pb_1 = require("./gen/test_grpc_pb");
var server = new grpc.Server();
server.addService(test_grpc_pb_1.TestService, {
    sayTest: function (call, callback) {
        call.on("data", function (data) {
            console.log("data", data);
            var res = new test_pb_1.TestRes();
            res.setName("Test");
            call.write(res);
        });
        // console.log(call.request.getName());
        // const res = new TestRes();
        // res.setName("Test " + call.request.getName());
        // callback(null, res);
    },
});
server.bindAsync("localhost:3333", grpc.ServerCredentials.createInsecure(), function () {
    server.start();
    console.log("rpc server started");
});
